package com.ship.contract.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ship.contract.bean.ConFiles;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author tangshixuan
 * @date 2023-9-1
 */
public interface ConFilesMapper extends BaseMapper<ConFiles> {

    /**
     * 根据合同id查询主id
     * @return
     */
    @Select("SELECT id FROM con_files WHERE conId = #{conId}")
    ConFiles getId(Long conId);

    /**
     * 获取合同id状态为1的所有信息
     * @return
     */
    @Select("SELECT * FROM con_files WHERE con_id = #{conId} AND file_type = #{fileType}")
    List<ConFiles> getConFilesByConIdAndFileType(@Param("conId") Long conId, @Param("fileType") int fileType);
}
